#include "CommandFlag.h"

void CommandFlag::execute() {
	if( _flagType == FLAG_INDEX ) {
		_logicFlag->flagTaskByIndex( _index );
	} else if( _flagType == FLAG_SEARCHTERM ) {
		_logicFlag->flagTaskBySearchTerm( _searchTerm );
	} else {
		// idle state
	}
}

CommandFlag::CommandFlag( int index ) {
	_flagType = FLAG_INDEX;
	_index = index;
}

CommandFlag::CommandFlag( string searchTerm ) {
	_flagType = FLAG_SEARCHTERM;
	_searchTerm = searchTerm;
}